#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>

using namespace std;

typedef struct A
{
	int value;
	int weight;
	float value_weight;
} A; 
//
A s[100] = { 0 };

int cmp(const void* e1, const void* e2)
{
	return (((A*)e2)->value_weight) - (((A*)e1)->value_weight);
}

int Func1(int n, int c, A* s)
{
	for (int i = 0; i < n; i++)
	{
		s[i].value_weight = (float)(s[i].value / s[i].weight);
	}
	qsort(s, n, sizeof(s[0]), cmp);
	return 0;
}

void test1()
{
	int n1 = 3, c1 = 50;
	s[0].value = 60, s[1].value = 100, s[2].value = 120;
	s[0].weight = 10, s[1].weight = 20, s[2].weight = 30;
	cout << Func1(n1, c1, s) << endl;
}

int main()
{
	test1();
	return 0;
}